package com.miraclemiles.oauth.service;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 提供登录用户增强信息
 * @author zhoudong
 */
public class LoginUser extends User {

	@Getter
	private Long id;
	@Getter
	private String nickName;
	@Getter
	private String avatar;
	@Getter
	private String mobile;

	public LoginUser(Long id, String nickName, String avatar, String mobile, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked,
			Collection<? extends GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
		
		this.id = id;
		this.nickName = nickName;
		this.avatar = avatar;
		this.mobile = mobile;
	}

	private static final long serialVersionUID = 1L;

}
